$(function () {
    $("#visual-save").click(visualAdd);
    $('#visual-modal').modal('show');

});

//
function visualAdd() {
    var saveBtn = 'visual-save';
    disabledById(saveBtn);
    var childId = $("#id").val();
    var code = $("#code").val();
    var parentCode = $("#parentCode").val();
    var scheduleId = $("#scheduleId").val();

    // 值
    var dqnlnl = $("#dqnlnl").val();
    var dqnlnj = $("#dqnlnj").val();
    var dqnddj = $("#dqnddj").val();
    var vqt = $("#vqt").val();
    var ljtgcs = $("#ljtgcs").val();

    var data = {
        childId: childId,
        code: code,
        parentCode:parentCode,
        dqnlnl:dqnlnl,
        dqnlnj:dqnlnj,
        dqnddj:dqnddj,
        vqt:vqt,
        ljtgcs:ljtgcs,
        scheduleId:scheduleId

    };
    $.ajax({
        url: basePath + "teacher/visualMerge",
        type: "post",
        data: data,
        success: function (data) {
            if (data.result == true) {
                window.location.reload();
                $("#visual-modal").modal('hide');
            } else {
                alert("保存失败" + (data.msg ? "：" + data.msg : "！"));
            }
            removeDisabled(saveBtn);
        }
    });

}




